using Microsoft.VisualStudio.Modeling;
using System.Collections.Generic;

namespace Dslfactory.wcfLanguage
{
 public partial class MessageContract
 {
  public override IEnumerable<FieldOrProperty> Members
  {
   get
   {
    foreach (FieldOrProperty member in MessageMembers)
     yield return member;
   }
  }

  internal override FieldOrProperty CreateMember(string fullTypeName)
  {
   return new MessageMember(Store, new PropertyAssignment(FieldOrProperty.MemberFullTypeNameDomainPropertyId, fullTypeName));
  }


  /// <summary>
  /// Find a member of given name
  /// </summary>
  /// <param name="name"></param>
  /// <returns></returns>
  internal new MessageMember FindMemberOfName(string name)
  {
   foreach (MessageMember member in MessageMembers)
    if (member.Name == name)
     return member;
   return null;
  }
 }
}
